import chalk from 'chalk'

export function log(type: 'error' | 'info' | 'success' | 'warning', ...msg: any[]) {
  const color = {
    error: 'red',
    info: 'blue',
    success: 'green',
    warning: 'yellow',
  }
  const prefix = chalk.bold.keyword(color[type])(`[cli-${type}]`)
  // eslint-disable-next-line
  console.log(prefix, ...msg)
}
